<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>		
	</head>
	<body>
		<p>
			5*:实现时间的显示功能，
			要求能显示星期几，年月日，小时分钟秒,并能随着时间的变化而变化。。。
		</p>
		<div id="time">
			<script>
				function updateTime() {
							var now = new Date();
							var weekDay = ['日', '一', '二', '三', '四', '五', '六'];
							var year = now.getFullYear();
							var month = now.getMonth() + 1;
							var day = now.getDate();
							var hour = now.getHours();
							var minute = now.getMinutes();
							var second = now.getSeconds();
							var week = weekDay[now.getDay()];
							var timeStr = year + '年' + month + '月' + day + '日 星期' + week + ' ' + hour + ':' + minute + ':' + second;
							document.getElementById('time').innerHTML = timeStr;		
						}
						setInterval(updateTime, 1000);
			</script>
		</div>
	</body>
</html>
